<template>
  <el-container>
    <el-header
      style="background-color: #363636; height: 60px; padding-top: 10px"
    >
      <el-row>
        <el-button
          type="text"
          @click="home()"
          style="
            color: #409eff;
            float: left;
            margin-left: 20px;
            font-size: 20px;
          "
          >Home</el-button
        >
        <el-button
          type="text"
          @click="logout()"
          style="color: red; float: right; margin-right: 20px"
          >注销</el-button
        >
        <el-button
          type="text"
          @click="like()"
          style="color: white; float: right; margin-right: 20px"
          >购物车</el-button
        >
      </el-row>
    </el-header>
    <el-main style="width: 60%; margin-left: 20%">
      <div style="margin-top: 50px">
        <el-row>
          <el-col :span="12">
            <img :src="this.product.pic" style="width: 400px; height: 400px" />
          </el-col>
          <el-col
            :span="12"
            style="
              display: flex;
              justify-content: left;
              padding-left: 20px;
              margin-top: 80px;
            "
          >
            <span style="text-align: left">
              <span style="font-size: 20px">{{ this.product.title }}</span>
              <br />
              <br />
              售价
              <span style="font-size: 25px; color: red"
                >￥{{ this.product.price }}</span
              >
              <br />
              <br />
              <i class="el-icon-success">满69包邮</i><br />
              <i class="el-icon-success">三方店铺</i><br />
              <i class="el-icon-success">7天无理由</i><br />
              <i class="el-icon-success">30天价保会员价保</i><br />
              <i class="el-icon-success">7天慢必赔</i>+
            </span>
          </el-col>
        </el-row>
        <el-row>
          <el-button
            type="primary"
            style="width: 200px; margin-left: 400px; font-size: 20px"
            @click="addLike()"
            >加入购物车</el-button
          >
        </el-row>
      </div>
      <div style="margin-top: 100px">
        <el-tabs v-model="activeName" type="card">
          <el-tab-pane label="商品介绍" name="first">
            <div v-if="this.product.details">
              <img
                v-for="item in this.product.details"
                :src="item"
                :key="item"
                style="width: 100%"
              />
            </div>
            <div v-else>
              <div v-if="type1()">
                <img
                  src="https://img.youpin.mi-img.com/shopmain/77efb388_58a7_48ca_a1ed_b3dce6127f20.jpeg?w=1080&amp;h=1590"
                  style="width: 100%"
                /><img
                  src="https://img.youpin.mi-img.com/shopmain/29cc4466_2938_4c33_ad76_bf83c8b43cb7.jpeg?w=1080&amp;h=1590"
                  style="width: 100%"
                /><img
                  src="https://img.youpin.mi-img.com/shopmain/e4b2c4fb_778f_4a93_8461_355ec3f81934.jpeg?w=1080&amp;h=1591"
                  style="width: 100%"
                /><img
                  src="https://img.youpin.mi-img.com/shopmain/f3e8f5c4_4d95_4b3a_ac4d_9519c2adb1d0.jpeg?w=1080&amp;h=1590"
                  style="width: 100%"
                /><img
                  src="https://img.youpin.mi-img.com/shopmain/d8a422f9_035b_4081_9dd2_7df0ac9b9648.jpeg?w=1080&amp;h=1590"
                  style="width: 100%"
                /><img
                  src="https://img.youpin.mi-img.com/shopmain/40160685_f72a_4bcc_aae0_0a5e0008b174.jpeg?w=1080&amp;h=1590"
                  style="width: 100%"
                /><img
                  src="https://img.youpin.mi-img.com/shopmain/7b4049c1_cc41_40c1_8401_22367886d0ad.jpeg?w=1080&amp;h=1591"
                  style="width: 100%"
                /><img
                  src="https://img.youpin.mi-img.com/shopmain/35035309_cdf8_4fcd_86e9_e9a0c3aaca63.jpeg?w=1080&amp;h=1590"
                  style="width: 100%"
                /><img
                  src="https://img.youpin.mi-img.com/shopmain/1fd3ab2f_e7ac_4a29_81f8_4a02a85c8425.jpeg?w=1080&amp;h=1590"
                  style="width: 100%"
                /><img
                  src="https://img.youpin.mi-img.com/shopmain/3444fb39_ad7c_4bf7_9126_7154e0e983e8.jpeg?w=1080&amp;h=1590"
                  style="width: 100%"
                /><img
                  src="https://img.youpin.mi-img.com/shopmain/0f0f69c6_ad92_4950_9434_ae6ad11bd6dd.jpeg?w=1080&amp;h=1591"
                  style="width: 100%"
                /><img
                  src="https://img.youpin.mi-img.com/shopmain/e8168531_a39c_493a_aed0_c55d96597541.jpeg?w=1080&amp;h=1590"
                  style="width: 100%"
                /><img
                  src="https://img.youpin.mi-img.com/shopmain/5c1cd94b_31b2_4bf5_8e8a_e3cb6faf0fdc.jpeg?w=1080&amp;h=1590"
                  style="width: 100%"
                /><img
                  src="https://img.youpin.mi-img.com/shopmain/cd7083aa_cbc5_42f1_a55a_8c4894e7f746.jpeg?w=1080&amp;h=1590"
                  style="width: 100%"
                /><img
                  src="https://img.youpin.mi-img.com/shopmain/75c568d1_9009_4317_a739_90c0e53f9857.jpeg?w=1080&amp;h=1590"
                  style="width: 100%"
                /><img
                  src="https://img.youpin.mi-img.com/shopmain/951a2b70_b9dc_40b4_a0c0_b917b54a13c1.jpeg?w=1080&amp;h=1590"
                  style="width: 100%"
                /><img
                  src="https://img.youpin.mi-img.com/shopmain/5e81487f_86c9_48e7_884c_cb6b9ef6ef73.jpeg?w=1080&amp;h=1591"
                  style="width: 100%"
                /><img
                  src="https://img.youpin.mi-img.com/shopmain/c2fc0874_c3ae_4be9_807a_fda474994dec.jpeg?w=1080&amp;h=1590"
                  style="width: 100%"
                /><img
                  src="https://img.youpin.mi-img.com/shopmain/793e3f8d_b0c2_459b_9bc3_8c5b108d8818.jpeg?w=1080&amp;h=1590"
                  style="width: 100%"
                /><img
                  src="https://img.youpin.mi-img.com/shopmain/a2784330_7424_4f67_af6d_2353308a83cc.jpeg?w=1080&amp;h=1590"
                  style="width: 100%"
                /><img
                  src="https://img.youpin.mi-img.com/shopmain/c9197ee1_e74c_4592_8d6e_3b4fb4bc6507.jpeg?w=1080&amp;h=1018"
                  style="width: 100%"
                /><img
                  src="https://img.youpin.mi-img.com/shopcenter/922b4733_da4e_4175_ab31_869633168ff4.png"
                  style="width: 100%"
                />
              </div>
              <div v-if="type2()">
                <div>
                  <img
                    src="https://img.youpin.mi-img.com/shopmain/c285651d_fd86_4ef8_8de4_520c5381d3d1.jpeg?w=1080&amp;h=991"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/00bdf053_40a4_48eb_b3c3_8ded9ed2dbae.jpeg?w=1080&amp;h=913"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/422a4e67_4357_402d_bcaf_cf1d77ada27a.jpeg?w=1080&amp;h=998"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/27ab0693_c974_45e8_95de_c0401905a816.jpeg?w=1080&amp;h=570"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/2c61f1db_16e9_4ed6_be2e_a38817057c48.jpeg?w=1080&amp;h=608"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/5e8a79fc_9d60_477e_8db7_1cf18a124078.jpeg?w=1080&amp;h=762"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/0d8001aa_77aa_4b45_af88_436f2e06a190.jpeg?w=1080&amp;h=1154"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/15dd0e91_6412_43e2_ab80_d05b7590e1f8.jpeg?w=1080&amp;h=726"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/3317f436_88c6_4ab3_b8d0_e0d79e1d112d.jpeg?w=1080&amp;h=710"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/3a4f86d5_7b21_4f0d_aa17_998d95098171.jpeg?w=1080&amp;h=914"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/2991c58f_e6f1_49e4_8850_69d6b314f52f.jpeg?w=1080&amp;h=445"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/e6436deb_9f1d_422a_9613_25af5cd6b4a8.jpeg?w=1080&amp;h=1013"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/5e38bdee_6cb2_4be4_9e06_a7a993672d84.jpeg?w=1080&amp;h=1145"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/ba5bda8d_dc84_4591_89dd_5fb8ad5b0c48.jpeg?w=1080&amp;h=812"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/f54f45fd_92e7_44d2_9951_2443ac07facc.jpeg?w=1080&amp;h=976"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/c527cc41_f50e_4565_b8ac_20209a81287c.jpeg?w=1080&amp;h=1091"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/5957582b_8b93_4282_836e_ce24d9c95566.jpeg?w=1080&amp;h=1027"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/fc1d4e7a_4bf7_47ca_a536_6bac0bf198e2.jpeg?w=1080&amp;h=1043"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/c924fbf0_c869_4625_ac8d_27e369dfd9d2.jpeg?w=1080&amp;h=1032"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/77796ea3_5ada_4024_bf97_bc7a53acf404.jpeg?w=1080&amp;h=781"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/d9845dea_0f00_4868_88e1_51292904ec72.jpeg?w=1080&amp;h=995"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/9783703f_b3d9_4aff_96c0_f3705c6f601e.jpeg?w=1080&amp;h=1248"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/9943103f_9132_4be4_91c0_f03dc338c0d4.jpeg?w=1080&amp;h=1129"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/1effe0c9_c82a_4395_9764_28ab92c14dfc.jpeg?w=1080&amp;h=972"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/7c5d6de5_b675_4595_ac7e_13662d9707b9.jpeg?w=1080&amp;h=1046"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/949a996e_7077_4639_8f4c_446495a40e84.jpeg?w=1080&amp;h=1042"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/01b1c6ee_eff5_44af_8a23_053a60a1a08f.jpeg?w=1080&amp;h=813"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/21e91add_4176_40bc_8f79_0f9a81929274.jpeg?w=1080&amp;h=696"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/1734f7a2_a332_4c7a_a5d4_16dbaa26955e.jpeg?w=1080&amp;h=1015"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/4d004d74_79f1_490f_8239_45ac5a2bcf31.jpeg?w=1080&amp;h=1209"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/1f0898a4_a89f_4abb_aca2_c61eddafadf7.jpeg?w=1080&amp;h=903"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/7f695357_0f64_4862_a16d_f279fc57397c.jpeg?w=1080&amp;h=1065"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/9474a837_06ef_4f29_b781_6465b3a92606.jpeg?w=1080&amp;h=1080"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/33dab73d_bfba_498c_8d5e_ced5d2ff6139.jpeg?w=1080&amp;h=830"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/a13300d0_7ff3_4c3e_8d2d_8659d855a068.jpeg?w=1080&amp;h=739"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/7e78b5b6_e968_4c6c_a668_86ac6fe36cd4.jpeg?w=1080&amp;h=882"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/750e6a81_ee39_4c23_8e74_a7fa047b6d2d.jpeg?w=1080&amp;h=877"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/8ad87979_68cb_4018_aae6_aab2b59eedbf.jpeg?w=1080&amp;h=821"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/74d4e0b7_e0f8_492b_913c_e81a5959f1cf.jpeg?w=1080&amp;h=746"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/58589270_56e5_4b66_a654_386829ce45ae.jpeg?w=1080&amp;h=1130"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/ce44a7a3_186f_4cff_baac_bcad44067476.jpeg?w=1080&amp;h=463"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopcenter/922b4733_da4e_4175_ab31_869633168ff4.png"
                    style="width: 100%"
                  />
                </div>
              </div>
              <div v-if="type3()">
                <div>
                  <img
                    src="https://img.youpin.mi-img.com/shopmain/471aba51_c9b4_47da_b8a1_13a2416176b1.jpeg?w=1080&amp;h=1568"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/b1f77999_462f_433c_bebb_654e30fed1de.jpeg?w=1080&amp;h=1568"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/bf63d6d5_e762_4f00_a755_c799a65147c3.jpeg?w=1080&amp;h=1569"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/caa1b876_ea49_4bd0_8711_be1a27ad12be.jpeg?w=1080&amp;h=1568"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/7f2c271e_dc79_4715_b6fc_d10b210b22ad.jpeg?w=1080&amp;h=1568"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/43899f65_2fcd_48ab_81ad_c7a819d965e5.jpeg?w=1080&amp;h=1568"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/72ad951e_f40f_4f09_8961_bae57bfc1464.jpeg?w=1080&amp;h=1568"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/6c35cd7f_83bb_49b9_8e88_39efb4cf9cc8.jpeg?w=1080&amp;h=1568"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/a4598701_3be6_474b_b94d_2aa6998cda90.jpeg?w=1080&amp;h=1569"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/5198c67f_89d5_412d_8f87_76f8b1334f83.jpeg?w=1080&amp;h=1568"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/2f784d5c_3322_46b6_9808_decfb2bb03f9.jpeg?w=1080&amp;h=1568"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/93e61c84_7e7b_4829_826e_4e0c603b955c.jpeg?w=1080&amp;h=1568"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/187060bc_8798_4261_9c0d_b6b02c734119.jpeg?w=1080&amp;h=1568"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/5aa9d2f1_93a0_4cc6_85fd_01ebd50fe15e.jpeg?w=1080&amp;h=1569"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/787382a8_8937_4f4e_a59d_d3e85cacad6b.jpeg?w=1080&amp;h=1568"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/b404c6af_12ee_4ea6_bbe3_99972da55f00.jpeg?w=1080&amp;h=1568"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/01b257af_4b94_4eb3_8912_f9da182d6d7f.jpeg?w=1080&amp;h=1568"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/85d218f7_fd59_4ab2_a35a_57ad4e7f9d91.jpeg?w=1080&amp;h=1568"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/c4ba9d58_cf7e_4cbd_8373_f7970c310ec4.jpeg?w=1080&amp;h=1256"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopcenter/922b4733_da4e_4175_ab31_869633168ff4.png"
                    style="width: 100%"
                  />
                </div>
              </div>
              <div v-if="type4()">
                <div>
                  <img
                    src="https://img.youpin.mi-img.com/shopmain/381410da6e6594e67ecc5d7ed64631da.jpg?w=1080&amp;h=120"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/171f03bc_cf25_4b19_ae25_dada83931818.jpeg?w=1080&amp;h=1427"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/3d3a256c_0755_44d9_b19e_23d89060b262.jpeg?w=1080&amp;h=810"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/60af59d4dd4184256091731c0b1b8425.jpg?w=1080&amp;h=1190"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/6dc2fa4687fd4f246d2ca074e2417270.jpg?w=1080&amp;h=649"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/1261715df514026018f36c17b416cc0d.jpg?w=1080&amp;h=1072"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/b1edd10bcd1f4d34e0cde58583c788bc.jpg?w=1080&amp;h=596"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/f2a21f0d261bc370cd60db648534a194.jpg?w=1080&amp;h=883"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/6531742dd33334c010950481dd06f1ae.jpg?w=1080&amp;h=939"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/014ff2769893b404f1d3d603596cf979.jpg?w=1080&amp;h=1139"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/ee53218f7b63654ddfe7a12b069c3f67.jpg?w=1080&amp;h=806"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/813b76f4a398ed2b4c01f7631423d389.jpg?w=1080&amp;h=830"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/cc4f722bed54a02328279ceee7cfea09.jpg?w=1080&amp;h=725"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/cafa6ea0d15787c02ad10831b759485f.jpg?w=1080&amp;h=716"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/a908a50c634c60ebcad044b283cd2330.jpg?w=1080&amp;h=865"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/fec3d0ac48fbdcc68f3351e980558482.jpg?w=1080&amp;h=854"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/e91e9fc31c2cac9b700a70296fb3a3cf.jpg?w=1080&amp;h=804"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/01bfc88934b64d7aa3f1526250e657aa.jpg?w=1080&amp;h=1020"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/8f61c02a8c8b995baaeeba24d0d12a97.jpg?w=1080&amp;h=833"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/35f4a4bf307aa3dfe345774a1312b09c.jpg?w=1080&amp;h=988"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/2005ef765f8ab67a0284170fb0c109e3.jpg?w=1080&amp;h=1080"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/06a2e28208c5fc692dd151a9edbb933b.jpg?w=1080&amp;h=808"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/2e472e631c483c1c42846c45eaa1844f.jpg?w=1080&amp;h=774"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/c500b664edb294ae16085e462a0c2bb1.jpg?w=1080&amp;h=1569"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/f5f8a4822c4c5487fc54726294a2e3f7.jpg?w=1080&amp;h=771"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/3a68d256_e7d7_47d6_abc1_a8566dc658a6.jpeg?w=1080&amp;h=1169"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/1f6123c095f3f9c956bd91d81f72da48.jpg?w=1080&amp;h=1500"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/ad7e3f48_d67c_4394_802a_9c7877b3336b.jpeg?w=1080&amp;h=1445"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/ca67f0495664ed79a6d607ba0112b862.jpg?w=1080&amp;h=1025"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/44dde03e92bcc393d6089a3f91e0ae42.jpg?w=1080&amp;h=677"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/f9ade31dd0a51c476ed3a84b1d452b52.jpg?w=1080&amp;h=1582"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/987058353d369674369b0f0a2363a2a1.jpg?w=1080&amp;h=1225"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/a748d5c51d1f8755ba43327a44e4f163.jpg?w=1080&amp;h=1705"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/074f843d3ac2eed191980bd8f36c22c3.jpg?w=1080&amp;h=1028"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/e2e6c727aab414b33d1becf45b04b429.jpg?w=1080&amp;h=758"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/03893e1c138ae842cfe1e6778d60af30.jpg?w=1080&amp;h=1312"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/e6588d89fddb115758653692c39942af.jpg?w=1080&amp;h=1144"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/9fff1092_3f2b_4707_b8ac_c60f8432b8b2.jpeg?w=1080&amp;h=1300"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/c1b0199e_585f_4e8e_81b4_476e84320de3.jpeg?w=1080&amp;h=1080"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/gms/43f7aeb9-b3b0-4e8b-b2b6-baccfaa772801668655212856.jpg?w=1080&amp;h=1499"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/gms/4b13ad87-2f34-4a43-bfc6-01d0ee2e690c1668655212892.jpg?w=1080&amp;h=1080"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/gms/6148f5f8-5b48-4951-bbec-77568a9dfa0a1668655212827.jpg?w=1080&amp;h=803"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopmain/52970989_f215_4de4_9fa1_5d60284a4f4f.jpeg?w=1080&amp;h=648"
                    style="width: 100%"
                  /><img
                    src="https://img.youpin.mi-img.com/shopcenter/922b4733_da4e_4175_ab31_869633168ff4.png"
                    style="width: 100%"
                  />
                </div>
              </div>
            </div>
          </el-tab-pane>
          <el-tab-pane label="评价" name="second">
            <div>
              <div
                v-for="comment in comments"
                :key="comment"
                style="text-align: left; margin-top: 10px"
              >
                <span style="font-size: 18px">{{ comment.userName }}: </span>
                <span style="font-size: 16px">{{ comment.comment }}</span>
                <el-divider></el-divider>
              </div>
            </div>
            <div style="margin-top: 50px">
              <el-input
                type="textarea"
                style="width: 80%; float: left"
                :autosize="{ minRows: 2 }"
                placeholder="请输入内容"
                v-model="newComment"
              >
              </el-input>
              <el-button type="primary" @click="addComment()"
                >提交评论</el-button
              >
            </div>
          </el-tab-pane>
        </el-tabs>
      </div>
    </el-main>
  </el-container>
</template>
  
  <script>
import store from "../store";

export default {
  name: "Detail",
  data() {
    return {
      activeName: "first",
      product: this.$route.params.product,
      comments: [],
      newComment: "",
    };
  },
  mounted: function () {
    // this.search(); //页面加载时自动执行
    if (!this.product) {
      this.$router.push({
        name: "Home",
      });
    }
    if (this.product.comments) {
      JSON.parse(this.product.comments).forEach((ele) => {
        this.comments.push(ele);
      });
    }
  },
  methods: {
    like() {
      this.$router.push({
        name: "Like",
      });
    },
    addComment() {
      if (!this.newComment || this.newComment.length == 0) {
        return;
      }
      this.$apiFun
        .addComment({
          comment: this.newComment,
          goodId: this.product.id,
        })
        .then((response) => {
          if (response["success"]) {
            alert("成功加入购物车");
          } else {
            alert(response["msg"]);
          }
        })
        .catch((err) => {
          console.log(err);
        });
    },
    addLike() {
      this.$apiFun
        .addLike({
          goodId: this.product.id,
        })
        .then((response) => {
          if (response["success"]) {
            alert("成功加入购物车");
          } else {
            alert(response["msg"]);
          }
        })
        .catch((err) => {
          console.log(err);
        });
    },
    type1() {
      return this.product && parseInt(this.product.type) == 1;
    },
    type2() {
      return this.product && parseInt(this.product.type) == 2;
    },
    type3() {
      return this.product && parseInt(this.product.type) == 3;
    },
    type4() {
      return this.product && parseInt(this.product.type) == 4;
    },
    handleSelect(key, keyPath) {
      this.activeIndex = key.toString();
      this.search();
    },
    home() {
      this.$router.push("/home");
    },
    logout() {
      this.$router.push("/");
    },
    search() {
      //   this.$apiFun
      //     .requestData({
      //       id: this.$route.params.product.id,
      //     })
      //     .then((response) => {
      //       if (response["success"]) {
      //       } else {
      //         alert(response["msg"]);
      //       }
      //     })
      //     .catch((err) => {
      //       console.log(err);
      //     });
    },
  },
};
</script>
  <style>
.image {
  width: 200px;
  height: 200px;
}
</style>
  